#ifndef LOG_H
#define LOG_H

#include <stdio.h>

#define UNUSED(x) ((void)(x))


#define LogLine(tag, ...)															\
	do{																				\
		printf(tag);																\
        printf(__VA_ARGS__);														\
        printf("\n");																\
	}while(0)
	
#define LogDebug(...)		LogLine("Debug   ", __VA_ARGS__)
#define LogInfo(...)		LogLine("Info    ", __VA_ARGS__)
#define LogWarn(...)		LogLine("Warn    ", __VA_ARGS__)
#define LogError(...)		LogLine("Error   ", __VA_ARGS__)
#define LogHex(tag, buf, len)                   \
    do{                                         \
		const char* data = (const char*)(buf);	\
		int c = (int)(len);						\
        printf("%s:", tag);                     \
		for(int i=0; i < c; i++)				\
		{										\
			printf("%02X ", data[i]);			\
		}										\
		printf("\n");							\
	}while(0)


#endif
